package ToYesterday;

import org.junit.Test;
public class Offer_50 {

    @Test
    public void Test50(){
        String str = "abaccdeff";
        char b = Solution50(str);
        System.out.println(b);
    }

    public char Solution50(String str){
        short[] charsTag = new short[26];
        char[] chars = str.toCharArray();
        for (char c:chars){
            charsTag[c-'a']++;
        }
        for (char c:chars){
            if (charsTag[c-'a']==1){
                return c;
            }
        }
        return ' ';
    }
}
